<?php
        @include_once("common.php");
        @include_once("conn.php");
        $reasch="select id,class,name,chinese,math,english,chinese+math+english as total from `study`";
        $result=mysqli_query($conn,$reasch);
        $list=array();
        while($item=mysqli_fetch_assoc($result)){
            $item["chinese"] = $item["chinese"]*1;
            $item["math"] = $item["math"]*1;
            $item["english"] = $item["english"]*1;
            $item["total"] = $item["total"]*1;
            array_push($list,$item);
        }



        $msg=array();
        if(count($list)>0){
        $msg["status"] = true; 
        $msg["detail"] = "ok"; 
        $msg["list"] = $list; 
        }else{
         $msg["status"] = false; 
        $msg["detail"] = "not found"; 
        $msg["list"] = array(); 
        }
        echo json_encode($msg);
?>